﻿export const routes = [
  {
    path: '/user/login',
    layout: false,
    hideInMenu: true,
    name: '登录',
    component: './Login',
  },
  {
    path: '/welcome',
    name: '欢迎',
    icon: 'smile',
    component: './Welcome',
  },
  {
    path: '/admin',
    name: '系统管理',
    icon: 'crown',
    routes: [
      { path: '/admin', redirect: '/admin/userList' },
      {
        path: 'userList',
        icon: 'smile',
        name: '用户列表',
        component: './system/userList',
      },
      {
        path: 'roleList',
        icon: 'smile',
        name: '角色列表',
        component: './system/roleList',
      },
      {
        path: 'menuList',
        icon: 'smile',
        name: '菜单列表',
        component: './system/menuList',
      },
    ],
  },
  {
    path: '/list',
    name: '查询表格',
    icon: 'table',
    component: './TableList',
  },
  {
    path: '/about',
    name: '关于我',
    icon: 'smile',
    component: './About',
  },
  {
    path: '/',
    redirect: '/welcome',
  },
  {
    path: '*',
    layout: false,
    component: './404',
  },
  {
    name: '图表',
    icon: 'smile',
    path: '/charts',
    component: './charts',
  },
  {
    name: '报告',
    icon: 'smile',
    path: '/report',
    component: './report',
  },
  {
    name: '猫猫云盘',
    icon: 'smile',
    path: '/filePan',
    component: './filePan',
  },
];

// 路由监听
export function onRouteChange({ location, clientRoutes, routes, action, basename, isFirst }) {
  console.log(location, clientRoutes, routes, action, basename, isFirst);
}
